package com.example.base.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.util.Arrays;

public class Md5Generator {
    private static final String delta = "aaaa";
    public static String getMD5String(String str) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(str.getBytes());
            String temp = Arrays.toString(md.digest()) + delta;
            md.update(temp.getBytes());
            return new BigInteger(1, md.digest()).toString(16);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
